package com.zsgeek.dao;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import com.zsgeek.db.DBUtils;
import com.zsgeek.db.ResultSetHandler;
import com.zsgeek.entity.Biz_price;

public class Biz_priceDao {
	
	/**
	 * 查询单笔手续费
	 * @param biz_price
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public static List<Biz_price> getByPrice() {
		String sql = "SELECT id,price FROM biz_price";
		return (List<Biz_price>) DBUtils.executeQuery(sql, new ResultSetHandler() {
			@Override
			public Object doHandler(ResultSet rs) throws SQLException {
				List<Biz_price> list = new ArrayList<Biz_price>();
				while (rs.next()) {
					Biz_price biz_price = new Biz_price();
					biz_price.setId(rs.getInt(1));
					biz_price.setPrice(rs.getFloat(2));
					list.add(biz_price);
				}
				rs.close();
				return list;
			}
		});
	}
}
